package cn.lili.modules.search.entity.dos;

import cn.lili.common.enums.WhetherEnum;
import cn.lili.common.utils.BeanUtil;
import cn.lili.elasticsearch.EsSuffix;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serial;

/**
 * EsSupplierGoodsIndex
 *
 * @author Chopper
 * @version v1.0
 * 2022-10-08 15:50
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Document(indexName = "#{@elasticsearchProperties.indexPrefix}_" + EsSuffix.SUPPLIER_GOODS_INDEX_NAME)
@ToString
@NoArgsConstructor
@Accessors(chain = true)
public class EsSupplierGoodsIndex extends EsGoodsIndex {


    @Serial
    private static final long serialVersionUID = 8542362452385370221L;

    /**
     * @see WhetherEnum
     */
    @Field(type = FieldType.Boolean)
    @ApiModelProperty(value = "支持代发")
    private Boolean supportProxy;

    @Field(type = FieldType.Boolean)
    @ApiModelProperty(value = "支持采购")
    private Boolean supportPurchase;

    @ApiModelProperty(value = "是否被代理")
    private Boolean isProxy;

    public EsSupplierGoodsIndex(EsGoodsIndex esGoodsIndex) {
        BeanUtil.copyProperties(esGoodsIndex, this);
    }

}
